import { Body, Controller, Post } from '@nestjs/common';
import { BookService } from './book.service';
import { FindBookDto } from './dto/find-book.dto';
import { CreateBookDto } from './dto/create-book.dto';

@Controller('book')
export class BookController {
  constructor(private readonly bookService: BookService) {}
  @Post('list')
  async list(@Body() body: FindBookDto) {
    return this.bookService.list(body);
  }
  @Post('create')
  create(@Body() body: CreateBookDto) {
    return this.bookService.create(body);
  }
  @Post('update')
  update(@Body() body: CreateBookDto) {
    return this.bookService.update(body);
  }
  @Post('delete')
  delete(@Body() body: FindBookDto) {
    return this.bookService.delete(body);
  }
}
